//
//  TokenCell.swift
//  GhostWorld
//
//  Created by Kam on 2018/6/18.
//  Copyright © 2018 LKGood. All rights reserved.
//

import UIKit

class TokenCell: UICollectionViewCell {
  
   // MARK: - IBOutlets
  
  @IBOutlet private weak var nameLabel: UILabel!
  @IBOutlet private weak var priceLabel: UILabel!
  @IBOutlet private weak var bgImageView: UIImageView!
  
  // MARK: - Lifecycle
  
  override var isSelected: Bool {
    didSet {
      bgImageView.image = UIImage(named: "TokenItemBg\(isSelected ? "HL" : "")")
    }
  }
  
  // MARK: - Public methods
  
  func prepare(token: Token) {
    nameLabel.text = token.name
    priceLabel.text = "¥\(token.price)元"
  }
}

extension TokenCell {
  static let defaultHeight: CGFloat = 50
}
